@use "../global/variables";

.main-navigation {
  width: 100%;
}

.main-navigation__items {
  display: flex;
  flex-direction: column;
}

.main-navigation__item {
  border-top: 1px solid variables.$base-secondary;

  &:last-of-type {
    border-bottom: 1px solid variables.$base-secondary;
  }

  &:active {
    .site-navigation__link {
      background-color: variables.$base-secondary;
    }
  }
}

.main-navigaion-link {
  display: block;
  padding: 20px 0;
  color: variables.$base-black;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

@media (min-width: variables.$min-tablet-width) {
  .main-navigation {
    width: auto;
  }

  .main-navigation__items {
    flex-direction: row;
  }

  .main-navigation__item {
    position: relative;
    border: none;

    &:last-of-type {
      border: none;
    }

    &:active {
      .main-navigaion-link {
        color: variables.$blue-primary;
        background-color: variables.$base-secondary;
      }
    }

    &--current {
      &::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        display: block;
        width: 100%;
        height: 2px;
        background-color: variables.$blue-primary;
      }
    }
  }

  .main-navigaion-link {
    padding: 32px 20px;
  }
}

@media (min-width: variables.$min-desktop-width) {
  .main-navigaion-items {
    gap: 20px;
  }

  .main-navigaion-link {
    &:hover,
    &:focus {
      color: variables.$blue-primary;
    }
  }
}
